<template>
	<view
		style="background-color: #ebebec;width: 100%;height: 100vh;padding:  2% 0;overflow-x: hidden;padding-bottom: 6%;">
		<!-- 项目管理 -->
		<view class="" v-for="(item,index) in dataList" :key="index" @click="goDetail(item)">
			<comList :title="item.projectName" :ststate="item.ststate" :listCom="dictionTable"
				:dictionContent="dataList[index]"></comList>
		</view>
		<view class="" style="position: fixed;bottom: 0%;width: 100%;background-color: white;height: 50px;">
			<uni-pagination :total="dataList.length" />
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				dataList: [],
				dictionTable: [
					//渲染的字典
					{
						title: '总包单位',
						value: 'contractUnit'
					},
					{
						title: '所属区域',
						value: 'belongArea'
					},
					{
						title: '开始时间',
						value: 'createTime'
					},
					{
						title: '结束时间',
						value: 'endTime'
					}
				]
			}
		},
		onLoad() {
			this.getProject();
		},
		methods: {
			getProject() {
				this.$request.post("/project/getProject", {
						data: {},
					})
					.then(res => {
						console.log(res, '项目信息')
						this.dataList = res.data.data;
					}).catch(err => {
						console.log('err', err);
					})
			},
			goDetail(item) {
				console.log(item, '详情')
				let dateDetail = JSON.stringify(item)
				uni.navigateTo({
					url: '/pages/comDetail/index?dateDetail=' + dateDetail + '&type=项目管理'
				})
			}
		}
	}
</script>
<style scoped lang="scss">
</style>